import Layout from '../views/layout/Layout'

const _import = require('./_import_' + process.env.NODE_ENV);

export default {
  path: '/appConfigCenter',
  component: Layout,
  name: 'appConfigCenter',
  meta: {
    title: 'App管理',
    icon: 'icon',
    roles: [1, 2, 3, 4, 5, 6, 7, 8]
  },
  children: [{
      path: "version",
      component: _import("set/version/list"),
      name: "setVersion",
      meta: {
        title: "APP版本设置",
        buttons: {
          add: {
            label: '新建',
            enabled: true
          },
          edit: {
            label: '编辑',
            enabled: true
          }
        }
      }
    },
    {
      path: 'list',
      component: _import('appConfig/list'),
      name: 'appConfig',
      meta: {
        title: 'App配置中心',
        buttons: {
          add: {
            label: '新建',
            enabled: true
          },
          edit: {
            label: '编辑',
            enabled: true
          },
          history: {
            label: '历史记录',
            enabled: true
          },
          historyRollBack: {
            label: '回滚',
            enabled: true
          }
        }
      },
    },
    {
      path: ':propertiesType/history',
      component: _import('appConfig/history'),
      name: 'appConfigHistory',
      meta: {
        title: 'App配置历史记录',
        icon: 'icon',
        index: '/appConfigCenter/list',
        buttons: {
          rollBack: {
            label: '回滚',
            enabled: true
          }
        }
      },
      hidden: true,
      props: true
    },
    {
      path: 'add',
      component: _import('appConfig/edit'),
      name: 'appConfigAdd',
      meta: {
        title: '新建App配置',
        icon: 'icon',
        index: '/appConfigCenter/list'
      },
      hidden: true
    },
    {
      path: 'edit/:id',
      component: _import('appConfig/edit'),
      name: 'appConfigEdit',
      meta: {
        title: '编辑App配置',
        icon: 'icon',
        index: '/appConfigCenter/list'
      },
      hidden: true,
      props: true
    },
    {
      path: "channelPackage",
      component: _import("set/package/channel-package"),
      name: "channelPackage",
      meta: {
        title: "渠道包管理",
        buttons: {
          add: {
            label: '新建',
            enabled: true
          },
          edit: {
            label: '编辑',
            enabled: true
          }
        }
      }
    },
    {
      path: "channelPackage/edit/:id",
      component: _import("set/package/channel-package-edit"),
      name: "channelPackageEdit",
      meta: {
        title: "渠道包管理编辑",
        noCache: true
      },
      props: true,
      hidden: true
    },
    {
      path: 'clearAppCache',
      component: _import('sysSetting/clearAppCache/index'),
      name: 'clearAppCache',
      meta: {
        title: 'APP首页缓存管理'
      },
    }
  ]
}
